# -*- coding: utf-8 -*-
import KBEngine
import IKernel
from KBEDebug import *
from interfaces_common.Common import Common

# 这个文件是专门用来发送引擎层到脚本层的实体回调函数
class CellEntityEvent(Common):
	def __init__(self):
		Common.__init__(self)

	def onEnterSpace(self):
		IKernel.Instance().onEvent(self.getScriptName(), "onEnterSpace", self.id, self.id,[])

	def onTeleportSuccess(self, nearbyEntity):
		IKernel.Instance().onEvent(self.getScriptName(), "onTeleportSuccess", nearbyEntity.id, self.id, [nearbyEntity])

	def onDestroy(self):
		IKernel.Instance().onEvent(self.getScriptName(), "onDestroy", self.id, self.id,[])

	def onEnteredView(self, entity):
		IKernel.Instance().onEvent(self.getScriptName(), "onEnteredView", entity.id, self.id,[entity])